<?php
class album_view extends SClass {

    public function process() {
        $user = $this->getUserSecure();
        if ($user) {
            if ($user->getLevel() >= 1) {
        	   $this->assign('autorized', 1);
            }
        }

        $this->assign('albumid', $this->getArgument('id'));

        $post = ServiceUtils::GetFactory()->getGalleryService()->getAlbumPhotosAll($this->getArgument('id'));
        $a = array();
        while ($x = $post->getNext()) {
            $a[] = array(
                'id' => $x->getId(),
                'title' => $x->getTitle(),
                'image' => MEDIA_DIR.'galery/'.$x->getImage(),
                'comment' => $x->getComment(),
                'postdate' => $x->getPostdate(),
                'url' => Engine_LinkMaker::GetURLByContentID('gallery_photo_view',
                    $x->getId()),
                'urledit' => Engine_LinkMaker::GetURLByContentID('gallery_photo_edit',
                    $x->getId()),
                'urldelete' => Engine_LinkMaker::GetURLByContentID('gallery_photo_delete',
                    $x->getId())
            );
        }
        $this->assign('postArray', $a);
   }

}
